require("../../../utils/api.js");

var t = require("../../../utils/disapi.js"), a = getApp();

Page({
    data: {
        status: 0,
        list: [],
        openid: "",
        page: 1,
        last: 0
    },
    onLoad: function(t) {
        wx.setNavigationBarColor({
            frontColor: wx.getStorageSync("basic").topcolor,
            backgroundColor: wx.getStorageSync("basic").topbg
        });
        var i = a.globalData.openid;
        this.setData({
            openid: i
        });
    },
    onShow: function(a) {
        var i = this, o = this.data.openid;
        t.get_dis_commoned_list({
            openid: o,
            page: this.data.page
        }).then(function(t) {
            if (0 == t.errno) {
                var a = t.data;
                console.log(a);
                i.setData({
                    last: 0,
                    list: a.list
                });
            }
        });
    },
    myTab: function(t) {
        var a = t.currentTarget.dataset.status;
        this.setData({
            status: a
        });
    },
    onReachBottom: function(a) {
        var i = this, o = this.data.page;
        if (1 == this.data.last) return !1;
        o = this.data.page;
        o += 1, t.get_dis_commoned_list({
            opneid: openid,
            page: o
        }).then(function(t) {
            if (0 == t.errno) {
                var a = t.data.list, o = i.data.list.concat(a);
                i.setData({
                    list: o
                });
            }
        });
    }
});